﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using EmailHelper.tool;

namespace EmailHelper.view
{
    /// <summary>
    /// Config.xaml 的交互逻辑
    /// </summary>
    public partial class Config : Window
    {
        public Config()
        {
            InitializeComponent();
        }

        private void Grid_Initialized(object sender, EventArgs e)
        {
            TB_smtp.Text = ConfigHelper.GetConfig("SMTPPath");
            TB_Port.Text = ConfigHelper.GetConfig("serverPort");
            TB_AuthCode.Text = ConfigHelper.GetConfig("authCode");
        }

        private void btn_save_Click(object sender, RoutedEventArgs e)
        {
            ConfigHelper.setConfigValue("SMTPPath", TB_smtp.Text.ToString());
            ConfigHelper.setConfigValue("serverPort", TB_Port.Text.ToString());
            ConfigHelper.setConfigValue("authCode", TB_AuthCode.Text.ToString());
        }
    }
}
